-- GENERATED SPELL FOR [Illidari Heartseeker] --


function spell0_23339(pUnit, Event) --@Curse of the Bleakheart,n/a--
pUnit:FullCastSpellOnTarget(41170,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23339', 582, 1)
end

function spell1_23339(pUnit, Event) --@Rapid Shot,Self--
pUnit:FullCastSpellOnTarget(41173,pUnit)
pUnit:RegisterEvent('Sorts_23339', 8000, 1)
end

function spell2_23339(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(41169,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23339', 664, 1)
end

function spell3_23339(pUnit, Event) --@Skeleton Shot,n/a--
pUnit:FullCastSpellOnTarget(41171,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23339', 30000, 1)
end

function Sorts_23339(pUnit, Event)
local choix_sorts_23339 = math.random(0, 3)
if choix_sorts_23339 == 0 then
pUnit:RegisterEvent('spell0_23339', 1, 1)
end
if choix_sorts_23339 == 1 then
pUnit:RegisterEvent('spell1_23339', 1, 1)
end
if choix_sorts_23339 == 2 then
pUnit:RegisterEvent('spell2_23339', 1, 1)
end
if choix_sorts_23339 == 3 then
pUnit:RegisterEvent('spell3_23339', 1, 1)
end
end

function mob23339_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23339', math.random(1500, 3000), 1)
end

function mob23339_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23339_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23339_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23339, 1, 'mob23339_Action')
RegisterUnitEvent(23339, 2, 'mob23339_Leave')
RegisterUnitEvent(23339, 3, 'mob23339_Kill')
RegisterUnitEvent(23339, 4, 'mob23339_Die')
